<?php

require './init.php';

// Get Listing of all reports
$reportPage = $api->Reports()->getAll();
$reports = $reportPage->getEntries();
var_dump($reports);
$firstReport = $reports[2];
var_dump($firstReport);

// Get the status for a certain job
$status = $api->Reports()->jobStatus($firstReport);
var_dump($status);

// Get the download url for a certain job
$url = $api->Reports()->jobDownloadURL($firstReport);
var_dump($url);

// Add a new Job
$job = $api->Reports()->newJob();
$job->selectedReportType = 'Keyword';
$job->name = 'Sample Keyword Report';
$job->aggregationTypes = 'Summary';
$job->adWordsType = 'SearchOnly';
$job->keywordType = 'Broad';
$job->startDay = '2008-01-01';
$job->endDay = '2009-10-31';
$job = $api->Reports()->scheduleJob($job);
var_dump($job);

$status = $api->Reports()->jobStatus($job);
var_dump($status);